<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
    </script>
    <script>
        $(document).ready(function(){
            $("#btn3").click(function(){
                alert("值为: " + $("#test").val(""));
            });
        });
    </script>
    <script>
        $(document).ready(function(){
            $("#btn1").click(function(){
                alert("Text: " + $("#test1").text());
            });
            $("#btn2").click(function(){
                alert("HTML: " + $("#test1").html());
            });
            $("#btn4").click(function(){
                alert("val: " + $("#test1").val());
            });
        });
    </script>
</head>

<body>
    <p>名称: <input type="text" id="test" value="菜鸟教程"></p>
    <button id = "btn3">显示值</button>
    <p id="test1">这是段落中的 <b>粗体</b> 文本。</p>
    <button id="btn1">显示文本</button>
    <button id="btn2">显示 HTML</button>
    <button id="btn4">显示 val</button>

</body>
</html>

